import { getAction, deleteAction, putAction, postAction, httpAction, postFormData } from '@/api/manage'
const gateway = '/gateway/api'
const jnby = '/jnby-boot'

export const querySysCateTree = (pcod) => getAction('/sys/category/querySysCateTree?async=true&code=' + pcod) // 分类标签
export const collectList = () => getAction('/sys/collect/list') // 查询当前用户收藏的应用
export const collectAdd = (params) => postAction('/sys/collect/add', params) // 收藏应用
export const collectCancel = (params) => getAction('/sys/collect/cancel', params) // 取消应用
export const collectQuery = (params) => getAction('/sys/collect/query', params) // 查询应用是否收藏-查询应用是否设置版本升级提醒
export const queryPermissionVersionList = (params) => getAction('/sys/permission/queryPermissionVersionList', params) // 查询菜单版本记录
export const addPermissionVersion = (params) => postAction('/sys/permission/addPermissionVersion', params) // 添加菜单版本记录
export const editPermissionVersin = (params) => postAction('/sys/permission/editPermissionVersin', params) // 编辑菜单版本记录
export const deletePermissionVersion = (params) => deleteAction('/sys/permission/deletePermissionVersion', params) // 删除菜单版本记录



//标签管理
export const queryLocationUrl = (params) => getAction(jnby + '/sys/permission/queryLocationUrl', params) // 查询外部菜单跳转URL
export const customerList = (params) => postAction(gateway + '/admin/customer/list', params) // 会员列表
export const batchChangeFashioner = (params) => postAction(gateway + '/admin/customer/batchChangeFashioner', params) // 批量变更搭配师
export const customerListCondition = (params) => postAction(gateway + '/admin/customer/customerListCondition', params) // 查询顾客列表56正常用户,57黑名单,58特殊用户
export const getCusListCondition = (params) => postAction(gateway + '/admin/customer/getCustomerListCondition', params) // 顾客列表查询条件加载(筛选树)
export const batchJoinCategory = (params) => postAction(gateway + '/admin/customer/batchJoinCategory', params) // 批量加入用户分类57黑名单,58特殊用户
export const getJoinCategoryReasonByCode = (params) => postFormData(gateway + '/admin/customer/getJoinCategoryReasonByCode', params) // 获取用户分类原因(19黑名单原因，70客户违约，20特殊名单原因)
export const queryCatePermisListByDepart = (params) => getAction(jnby + '/sys/category/queryCatePermisListByDepart', params) // 查询当前登录用户所在部门的分类字典
export const getFashioners = (params) => postAction(gateway + '/admin/customer/getFashioners', params) // 获取所有搭配师
export const getCommunicationByUnionId = (params) => postAction(gateway + '/admin/customer/getCommunicationByUnionId', params) // 根据顾客unionId查询沟通记录
export const getCartByUnionId = (params) => postAction(gateway + '/admin/customer/getCartByUnionId', params) // 根据顾客unionId查询购物车商品
export const getFashionerRecord = (params) => postAction(gateway + '/admin/customer/getFashionerRecord', params) // 根据顾客unionId查询搭配师记录
export const subHistory = (params) => postAction(gateway + '/admin/customer/subHistory', params)// 订阅记录
export const saveCustomer = (params) => postAction(gateway + '/admin/customer/saveCustomer', params)// 保存用户信息
export const getFashionerSubStatus = (params) => postAction(gateway + '/admin/customer/getFashionerSubStatus', params) // 批量接口 获取搭配师卡订阅状态

// 会员标签
let marketingMember = gateway + '/admin/marketing/member'
export const marketingMemberList = (params) => postAction(`${marketingMember}/list`, params) // 会员标签列表
export const marketingMemberImport = (params) => postAction(`${marketingMember}/import`, params) // 导入数据
export const marketingMemberEnable = (params) => postAction(`${marketingMember}/enable`, params) // 禁用/启用会员标签
export const marketingMemberDowFail = (params) => getAction(`${marketingMember}/download/fail`, params) // 下载导入失败数据
export const marketingMemberDowDetail = (params) => getAction(`${marketingMember}/download/detail`, params) // 下载明细
export const marketingMemberDelete = (params) => postAction(`${marketingMember}/delete`, params) // 删除会员标签
export const marketingMemberAdd = (params) => postAction(`${marketingMember}/add`, params) // 添加会员标签